<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.wenwu.common.utils.Status.AttachmentFrom"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>考古立项表单</title>
<script type="text/javascript" src="${path}/js/scripts/bootstart.js"></script>
<link rel="stylesheet" type="text/css" href="${path}/css/focus.css" />
</head>
<body>
	<script type="text/plain" id="myEditorFile"></script>
	<form id="dataForm" method="post">
		<div style="display:none">
			<input id="workId" name="workId" class="mini-textbox" />
		</div>
		<div class="form_nav">
			<table width="100%" cellpadding="4" cellspacing="0">
				<tr>
					<td width="10%" class="xx_bt nonebor">项目编号:</td>
					<td width="23%" class="xx_type  nonebor"><input name="code"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls"> </span></td>
					<td width="10%" class="xx_bt nonebor">项目名称:</td>
					<td width="23%" class="xx_type  nonebor"><input name="projectName"
						style="width: 90%;" class="mini-textbox" vtype="maxLength:100" /><span
						class="required_cls"> </span></td>
				</tr>
				<tr>
					<td width="10%" class="xx_bt ">项目描述:</td>
					<td width="23%" class="xx_type  " colspan="5"><input name="display"
						style="width: 90%;" class="mini-textarea" vtype="maxLength:1000" /><span
						class="required_cls"> </span></td>
				</tr>
				<c:if test="${param.flag=='edit' || param.flag=='show'}">
					<tr>
						<td class="xx_bt">项目情况:</td>
						<td class="xx_type" colspan="5">
							<a class="mini-button" onclick="addform.m1Add">文物调查</a> 
							<a class="mini-button" onclick="addform.m2Add">考古勘探</a>
							<a class="mini-button" onclick="addform.m3Add">考古发掘</a> 
					</tr>
				</c:if>
			</table>
		</div>
		<div style="text-align: center; padding: 10px;">
			<c:if test="${param.flag!='show'}">
				<a class="mini-button" onclick="addform.saveData" id="sub_button"
					iconCls="icon-save" style="width: 60px; margin-right: 20px;">保存</a>
			</c:if>
			<a iconCls="icon-cancel" class="mini-button" onclick="$.form.onClose()" style="width: 60px;">取消</a>
		</div>
	</form>
</body>
<script type="text/javascript" src="${path}/js/scripts/dataform.js"></script>
<script type="text/javascript" charset="utf-8" src="${path}/js/scripts/swfupload/swfupload.js"></script>
<script type="text/javascript" src="${path}/js/scripts/plugin/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="${path}/js/scripts/plugin/ueditor/ueditor.all.js"></script>
<script type="text/javascript" src="${path}/js/upload.js"></script>
<script type="text/javascript" src="${path}/js/message.js"></script>
<script type="text/javascript">
	var doc = $(document);
	$(function() {
		$.form.init(); //初始化表单
		window.addform = {};
		addform.saveData = function() {
			var form = new mini.Form("#dataForm");
			form.validate();
			if (form.isValid() == false) {
				return;
			}
			$.form.saveData({
				url : "${path}/mgr/workmain/saveaddForm",
				showMsg : true,//是否显示提示信息（返回参数必须是msg，json类型数据）
				id : "dataForm"
			});
		};
		
		addform.m1Add = function() {//文物调查
			var workId = $("input[name=workId]").val();
			var mName = encodeURI(encodeURI($("input[name=projectName]").val()));
			var code = encodeURI(encodeURI($("input[name=code]").val()));
			$.form.edit({
				url : "${path}/mgr/worksurvey/addForm?flag=${param.flag}&workId="+workId+"&projectName="+mName+"&number="+code,
				title : "文物调查添加/修改",
				formId : "dataForm",
				fieldId : "workId",
				fieldIdValue:workId,
				width : doc.width() * 0.9 + "px",
				height : doc.height() * 0.9 + "px",
				dataUrl : "${path}/mgr/worksurvey/showUpdate?workId="+workId
			});
		};
		addform.m2Add = function() {//考古勘探
			var workId = $("input[name=workId]").val();
			var mName = encodeURI(encodeURI($("input[name=projectName]").val()));
			var code = encodeURI(encodeURI($("input[name=code]").val()));
			$.form.edit({
				url : "${path}/mgr/archaeological/addForm?flag=${param.flag}&workId="+workId+"&projectName="+mName+"&code="+code,
				title : "考古勘探添加/修改",
				formId : "dataForm",
				fieldId : "workId",
				fieldIdValue:workId,
				width : doc.width() * 0.9 + "px",
				height : doc.height() * 0.9 + "px",
				dataUrl : "${path}/mgr/archaeological/showUpdate?workId="+workId
			});
		};
		addform.m3Add = function() {//考古勘探
			var workId = $("input[name=workId]").val();
			var mName = encodeURI(encodeURI($("input[name=projectName]").val()));
			var code = encodeURI(encodeURI($("input[name=code]").val()));
			$.form.edit({
				url : "${path}/mgr/excavation/addForm?flag=${param.flag}&workId="+workId+"&projectName="+mName+"&excCode="+code,
				title : "考古发掘添加/修改",
				formId : "dataForm",
				fieldId : "workId",
				fieldIdValue:workId,
				width : doc.width() * 0.9 + "px",
				height : doc.height() * 0.9 + "px",
				dataUrl : "${path}/mgr/excavation/showUpdate?workId="+workId
			});
		};
		
	});
	//页面初始化时，执行该函数资源类型
	window.onload = function() {
		mini.get("workId").setValue("${param.workId}");
	};
</script>
</html>